package violentRecursion;

/**
 * @author kunkun
 * @className LeetCode_70
 * @Description 爬楼梯
 * @date 2025/3/17 15:05
 */
public class LeetCode_70 {

    public int climbStairs(int n) {
        //1. 设置初始值
        int[] res = new int[n+1];
        res[0] = 1;
        res[1] = 1;
        for (int i = 2; i < n+1; i++) {
            res[i] = res[i-1]+res[i-2];
        }
        return res[n];
    }


}
